package com.weds.data_sync.pojo.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Description 执行脚本请求参数
 * @Author lihw
 * @Date 2024/1/2 17:12
 */
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Data
@Schema(name = "ScriptRequestDto", description = "执行脚本请求参数")
public class ScriptRequestDto {

    @Schema(description = "脚本所在路径")
    private String dir;

    @Schema(description = "模块名")
    private String module;

    @Schema(description = "类名")
    private String className;

    @Schema(description = "方法名")
    private String method;

    private DBInfo dbInfo;


    @Schema(description = "sessionId")
    private String ackId;

    @Schema(description = "请求参数")
    private Object data;

    @NoArgsConstructor
    @AllArgsConstructor
    @Builder
    @Data
    @Schema(name = "DBInfo", description = "数据库信息")
    public static class DBInfo {
        @Schema(description = "数据库ip")
        private String ip;
        @Schema(description = "数据库端口")
        private String port;
        @Schema(description = "数据库名称")
        private String dbname;
        @Schema(description = "登录用户名")
        private String username;
        @Schema(description = "登录密码")
        private String password;
        @Schema(description = "数据库类型: 1 pg, 2 mysql")
        private Integer type;

    }

}
